package com.dao;

import com.domain.Article;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

/**
 * @author cyt
 * @date 2020/9/19
 */
@Repository
public class ArticleDaoImpl implements ArticleDao{

    @Autowired
    private JdbcTemplate jdbcTemplate;

    public void insert(Article article) {
        String sql = "Insert into t_article values(null, ?, ?)";

        jdbcTemplate.update(sql, article.getTitle(), article.getContent());
    }
}
